const listService = require("../service/list.service")

class SearchController {
  async search(ctx, next) {
    const { content } = ctx.query
    const res = await listService.findListByContent(content)
    if(res.length) {
      ctx.body = {
        status: 200,
        data: res 
      }
    }
    else {
      ctx.body = {
        status: 204,
        message: '很遗憾，没有找到相关房源~'
      }
    }
  }

}



module.exports = new SearchController()